package com.work.yshop.mvp;

/**
 * MVP架构的基础Presenter抽象类
 * @param <V> View接口类型
 */
public abstract class BasePresenter<V extends BaseView> {
    protected V view;

    /**
     * 绑定View
     * @param view View接口实现
     */
    public void attachView(V view) {
        this.view = view;
    }

    /**
     * 解绑View
     */
    public void detachView() {
        this.view = null;
    }

    /**
     * 检查View是否已绑定
     * @return 是否已绑定
     */
    public boolean isViewAttached() {
        return view != null;
    }
} 